#include<iostream>
#include<cstdio>
using namespace std;
int t,n,head,tail,a[1000005],b[1000005],cz[1000005];
bool bz;
bool pd()
{
	for (int i=1;i<=n;++i)
		if (b[i]!=b[2*n-i+1]) return false;
	return true;
}
void dg(int x)
{
	if (x>2*n)
	{
		if (pd())
		{
			for (int i=1;i<=2*n;++i)
				if (cz[i]==0) printf("L");
				else printf("R");
			bz=true;
		}
		return;
	}
	cz[x]=0;
	b[x]=a[head++];dg(x+1);head--;
	if (bz) return;
	cz[x]=1;
	b[x]=a[tail--];dg(x+1);tail++;
}
int main()
{
	freopen("palin.in","r",stdin);freopen("palin.out","w",stdout);
	scanf("%d",&t);
	while (t--)
	{
		scanf("%d",&n);
		for (int i=1;i<=2*n;++i)
			scanf("%d",&a[i]);
		head=1;tail=2*n;
		bz=false;
		dg(1);
		if (!bz) printf("-1");
		printf("\n");
	}
	return 0;
}
